import cv2 as cv


def vide_demo():
  capture = cv.VideoCapture(0)
  while(True):
    ret, frame = capture.read()
    frame = cv.flip(frame, 1)
    cv.imshow("video", frame)
    c = cv.waitKey(50)
    if c == 27:
      break

# 获取图片信息
def get_image_info(image):
  print(type(image))
  print(image.shape)
  print(image.size)
  print(image.dtype)


src = cv.imread("C:/Users/Toma/Desktop/new_face/head.jpg")
cv.namedWindow("MY IMG", cv.WINDOW_AUTOSIZE)
cv.imshow("MY IMG", src)
get_image_info(src)
gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
cv.imwrite("C:/Users/Toma/Desktop/new_face/head__.jpg", gray)
cv.waitKey(0)
cv.destroyAllWindows();
